﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TrafficLightEmulator.RoadFramework
{
    class CollectionObjects
    {
        private static CollectionObjects inst = null;
        private static readonly object padlock = new object();
        public static CollectionObjects instance()
        {
            lock(padlock)
            {
                if( inst == null)
                    inst = new CollectionObjects();
                return inst;
            }
        }

        private CollectionObjects()
        {
            __ElementsList = new List<TrafficLightEmulator.RoadFramework.RoadElements.BaseRoadElement>();
            __ElementsList.Clear();

        }
        public void Add(TrafficLightEmulator.RoadFramework.RoadElements.BaseRoadElement obj)
        {
            __ElementsList.Add(obj);
        }
        private List<TrafficLightEmulator.RoadFramework.RoadElements.BaseRoadElement> __ElementsList;

    }
}
